package org.springframework.zp.batis.dao;

import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface TMapper {

/*
	DROP TABLE IF EXISTS `t`;
	CREATE TABLE `t`  (
			`id` int(0) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  `desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
	PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;

-- ----------------------------
		-- Records of t
-- ----------------------------
	INSERT INTO `t` VALUES (1, 'n1', 'd1');
	INSERT INTO `t` VALUES (2, 'n2', 'd2');

	SET FOREIGN_KEY_CHECKS = 1;
*/


	@Select("select * from t")
	List<Map<String, Object>> queryFroList();

	// 执行数据库查询
	@Select("select * from t where id =${id}")
	Map<String, Object> queryFroMap(Integer id);
}
